import 'package:development_assistant/config/db_config.dart';
import 'package:development_assistant/massage/massage.dart';
import 'package:development_assistant/router/app_router.dart';
import 'package:development_assistant/ui/screen/home/home.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:flutter/material.dart';

void main() async{
  WidgetsFlutterBinding.ensureInitialized();
  await DBConfig.initDB();
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {

    return ScreenUtilInit(
      designSize: const Size(360, 690),
      minTextAdapt: true,
      splitScreenMode: true,
      builder: (context , child) {
        return GetMaterialApp(
          locale: Get.deviceLocale,
          translations: Messages(),
          theme: ThemeData.light(),
          fallbackLocale: const Locale("cn","CN"),
          getPages: AppRouter.appRouters(),
          initialRoute: AppRouter.initRouter(),
        );
      },
    );
  }
}